<?php echo module_open('Liên hệ khách hàng', '', true, $page_list, true, true); ?>
<tr>
    <?php if ($GLOBALS['per']['del']) echo '<td class="head center" width="1%"><input type="checkbox" class="checkAll" /></td>'; ?>
  	<td class="head center" width="2%">#</td>
    <td class="head" width="15%">Khách hàng</td>
    <td class="head hide980" width="10%">Điện thoại</td>
    <td class="head hide980" width="25%">Tiêu đề</td>
    <td class="head hide480" width="12%">Thời gian</td>
    <td class="head hide1200" width="8%">IP</td>
    <td class="head center" width="5%"><span class="hide480">Trả lời</span></td>
    <td class="head hide640" width="12%">Nhận trả lời</td>
  	<td class="head center" width="1%">&nbsp;</td>
</tr>
<?php
if(count($contacts) && is_array($contacts))
{
	$i = 1;
	foreach ($contacts as $row)
	{
		$date_view = $row['date_view'];
		if ($date_view == 1) $date_view = 'Chưa đọc';
		else if ($date_view == 0) $date_view = '<span style="color: red;">Chưa gửi</span>';
		else $date_view = '<span style="color: green;">'.strftime(TIME_STR, $date_view).'</span>';
?>
<tr class="highlight<?php echo ($row['isnew'] ? ' table-flag-red' : '') ?>" id="<?php echo $row['id'] ?>" name="<?php echo $row['name_vn'] ?>">
	<?php if ($GLOBALS['per']['del']) echo '<td class="fr center">'.sel_item($row['id']).'</td>'; ?>
	<td class="fr center"><?php echo stt($row['id'], $GLOBALS['var']['rowstart'] + $i++) ?></td>
	<td class="fr"><?php echo $row['name_vn'] ?></td>
    <td class="fr hide980"><?php echo $row['phone'] ?></td>
	<td class="fr hide980"><?php echo $row['title'] ?></td>
	<td class="fr hide480"><?php echo strftime(TIME_STR, strtotime($row['date_added'])) ?></td>
	<td class="fr hide1200"><?php echo $row['ip'] ?></td>
	<td class="fr center">
        <?php echo ($row['status'] ? '<div title="Đã trả lời" class="icon glyphicons check"></div>' : '<div title="Chưa trả lời" class="icon glyphicons unchecked"></div>') ?>
    </td>
    <td class="fr hide640"><?php echo $date_view ?></td>
	<td class="fr center" nowrap="nowrap">
		<?php if ($GLOBALS['per']['edit']) echo '<a href="'.$site_url.'/reply/'.$row['id'].$uri_str.'" title="Trả lời"><div class="icon glyphicons send"></div></a>'; ?>
		<?php if ($GLOBALS['per']['del']) echo del_restore_link($row['id'], $row['deleted']) ?>
	</td>
</tr>
<?php
	}
}
else
{
	echo no_data_mes(10);
}
echo module_close();
?>